<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="/interceptor.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@page isELIgnored="false" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人信息</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function setit() {
		var tel = /^1[0-9]{10}$/;
		var name = document.getElementById("dname").value;
		var telephone = document.getElementById("dtelephone").value;
		if (name == null || name == "") {
			alert("昵称不能为空！");
			return false;
		} else if (telephone == null || telephone == "") {
				alert("手机号不能为空！");
				return false;
		} else if (!tel.test(telephone)) {
				alert("手机号不合法！");
				return false;
		} else if (confirm("您是否确定要修改吗？")) {
				document.forms[0].submit();
				return true;
			}

	}
	function back(){
			history.go(-1);
	}
</script>
</head>

<body>
<%-- <%@ include file="login_check.jsp" %> --%>

<form id="myForm" name="myForm" action="doctorupdate" method="post">
	<input type="text" name="id" value="${doctor.id}" id="id"/>
	<div class="action">
		<div class="t">
			医生信息
		</div>
		<div class="pages">
			<table width="90%" border="0" cellspacing="0" cellpadding="0" style="margin-top:15px">
				<tr>
					<td align="right" width="30%">姓名：</td>
                    <td align="left"><input type="text" name="name" value="${doctor.name}" id="dname"/></td>
				</tr>
				<tr>
					<td align="right" width="30%">性别：</td>
                    <td align="left">
                    	<select id="dsex" name="sex">
							<c:if test="${doctor.sex=='1'}">
								<option value="1" >女</option>
							</c:if>
							<c:if test="${doctor.sex=='2'}">
								<option value="2" >男</option>
							</c:if>
    							<c:if test="${doctor.sex!='1'}">
    								<option value="1" >女</option>
    							</c:if>
    							<c:if test="${doctor.sex!='2'}">
    								<option value="2" >男</option>
   								</c:if>
   						</select>
                     </td>
				</tr>
				<tr>
					<td align="right" width="30%">手机：</td>
                    <td align="left"><input type="text" name="phone" value="${doctor.phone}" id="dtelephone" maxlength="11"/>
                    <font color="red">*</font></td>
				</tr>
				<tr>
					<td align="right" width="30%">邮箱：</td>
                    <td align="left"><input type="text" name="email" value="${doctor.email}" id="demail"/></td>
				</tr>
				<tr>
					<td align="right" width="30%">生日：</td>
					<td align="left"><input type="text" name="birthday" value="${doctor.birthday}" id="birthday"/></td>
				</tr>
				<tr>
					<td align="center" colspan="2"><br/>
                    	<input type="button"  id="save" value="保存数据" onclick="setit();" />
                   		<input type="button"  id="re_to" value="返回" onclick="back();" />
                    </td>
				</tr>
			</table>			
		</div>
	</div>
</form>
</body>
</html>